import numpy as np

from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

size = 10

x = np.arange(0, size, 0.1)
y = np.arange(0, size, 0.1)
x, y = np.meshgrid(x, y)

z = np.sin(x) + np.cos(y)

# 三维曲面
figure = plt.figure()
ax = Axes3D(figure)
ax.plot_surface(x, y, z, alpha=0.3, cmap='winter')
ax.contour(x, y, z, zdim='z', offset=-2, cmap='rainbow')  # 等高线

plt.show()
